From 3cea23d685c92dff892aebff01bd1908c4b7e169 Mon Sep 17 00:00:00 2001
From: Andriy Grytsenko <andrej@rep.kiev.ua>
Date: Mon, 19 Nov 2012 23:41:10 +0200
Subject: [PATCH 15/22] Adding tooltips for file name and location in file
 properties.

In case when file name is too long to be shown in the field it will be
truncated so user cannot see it. Adding tooltip with full file name
and full file path helps to see it in any case.
The commit implements showing tooltips on base of text lenght, not
rendering size. That probably should be changed later.
---
 src/gtk/fm-file-properties.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gtk/fm-file-properties.c b/src/gtk/fm-file-properties.c
index ec672b7..3d79cdf 100644
--- a/src/gtk/fm-file-properties.c
+++ b/src/gtk/fm-file-properties.c
@@ -772,9 +772,16 @@ static void update_ui(FmFilePropData* data)
         time_t atime;
         struct tm tm;
         gtk_entry_set_text(data->name, fm_file_info_get_disp_name(data->fi));
+        /* FIXME: check if text fits in line */
+        if(strlen(fm_file_info_get_disp_name(data->fi)) > 16)
+            gtk_widget_set_tooltip_text(GTK_WIDGET(data->name),
+                                        fm_file_info_get_disp_name(data->fi));
         if(parent_str)
         {
             gtk_label_set_text(data->dir, parent_str);
+            /* FIXME: check if text fits in line */
+            if(strlen(parent_str) > 16)
+                gtk_widget_set_tooltip_text(GTK_WIDGET(data->dir), parent_str);
             g_free(parent_str);
         }
         else
-- 
1.8.0.1

